package org.csu.demo.domain;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

@Data
@TableName("profile")
public class Profile {
    @TableId("userid")
    private String username;
    @TableField(value = "favcategory",updateStrategy = FieldStrategy.IGNORED)
    private String favoriteCategory;
    @TableField("mylistopt")
    private boolean myListOption;
    @TableField("banneropt")
    private boolean bannerOption;
    @TableField("langpref")
    private String languagePreference;

    @JsonIgnore
    public boolean notAllNull(){
        return (favoriteCategory!=null || myListOption || bannerOption || languagePreference!=null);
    }

}
